<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>用户登录</title>
    <div data-th-replace="~{fragment/common :: common}"></div>
</head>
<body>
<div data-th-replace="~{fragment/header :: header}"></div>
<div class="body-container login">
    <form data-th-action="@{/login}" method="POST" data-th-object="${userAuth}">
        <h2>用户登录</h2>
        <!--下面是用户名输入框-->
        <div class="input-group">
            <span class="input-group-addon">账号</span>
            <input id="userName" name="username" type="text" class="form-control" placeholder="username"/>
        </div>
        <span data-th-if="${#fields.hasErrors('username')}" data-th-errors="*{username}" class="text-danger"></span>
        <br/>
        <!--下面是密码输入框-->
        <div class="input-group">
            <span class="input-group-addon">密码</span>
            <input id="password" name="password" type="password" class="form-control"
                   placeholder="password"
            />
        </div>
        <span data-th-if="${#fields.hasErrors('password')}" data-th-errors="*{password}" class="text-danger"></span>
        <br/>
        <!--下面是登陆按钮,包括颜色控制-->
        <button type="submit" style="width:280px;" class="btn btn-default">登 录</button>

        <br/><br/>
        <p style="color:green" data-th-text="${successMsg}"></p>
        <p style="color:red" data-th-text="${errorMsg}"></p>

    </form>
</div>
<div data-th-replace="~{fragment/footer :: footer}">...</div>
</body>
</html>